// 文章
import request from '@/utils/request'
// 文章获取列表
export const getArtileAPI = ({ channelId, timestamp }) => {
  return request({
    url: '/v1_0/articles',
    params: {
      channel_id: channelId,
      timestamp: timestamp || new Date().getTime() + ''
    }
  })
}

// 获取指定文章详情
export const getArticleCheckAPI = ({ id }) => {
  return request({
    url: `/v1_0/articles/${id}`

  })
}

// 作者-关注
export const AutfollowAPI = ({ target }) => {
  return request({
    url: '/v1_0/user/followings',
    method: 'POST',
    data: {
      target: target
    }
  })
}

// 作者-取消关注
export const AutdisfollowAPI = ({ id }) => {
  return request({
    url: `/v1_0/user/followings/${id}`,
    method: 'DELETE'

  })
}

// 文章喜欢
export const likeartAPI = ({ target }) => {
  return request({
    url: '/v1_0/article/likings',
    method: 'POST',
    data: {
      target: target
    }
  })
}

// 文章不喜欢

export const dislikeartAPI = ({ id }) => {
  return request({
    url: `/v1_0/article/likings/${id}`,
    method: 'DELETE'

  })
}
